package com.sweets.look.adapter;

import android.graphics.Bitmap;

public class HistoryItem implements Comparable {
    private Bitmap mBitmap;
    private String mFolder;
    private int mId;
    private int mImageId;
    private int mOrder;
    private String mTitle;
    private String mUrl;

    public HistoryItem() {
        super();
        this.mId = 0;
        this.mUrl = "";
        this.mTitle = "";
        this.mFolder = "";
        this.mBitmap = null;
        this.mImageId = 0;
        this.mOrder = 0;
    }

    public HistoryItem(String url, String title, String folder) {
        super();
        this.mId = 0;
        this.mUrl = "";
        this.mTitle = "";
        this.mFolder = "";
        this.mBitmap = null;
        this.mImageId = 0;
        this.mOrder = 0;
        this.mUrl = url;
        this.mTitle = title;
        this.mFolder = folder;
        this.mBitmap = null;
    }

    public HistoryItem(int id, String url, String title) {
        super();
        this.mId = 0;
        this.mUrl = "";
        this.mTitle = "";
        this.mFolder = "";
        this.mBitmap = null;
        this.mImageId = 0;
        this.mOrder = 0;
        this.mId = id;
        this.mUrl = url;
        this.mTitle = title;
        this.mBitmap = null;
    }

    public HistoryItem(String url, String title) {
        super();
        this.mId = 0;
        this.mUrl = "";
        this.mTitle = "";
        this.mFolder = "";
        this.mBitmap = null;
        this.mImageId = 0;
        this.mOrder = 0;
        this.mUrl = url;
        this.mTitle = title;
        this.mBitmap = null;
    }

    public HistoryItem(String url, String title, int imageId) {
        super();
        this.mId = 0;
        this.mUrl = "";
        this.mTitle = "";
        this.mFolder = "";
        this.mBitmap = null;
        this.mImageId = 0;
        this.mOrder = 0;
        this.mUrl = url;
        this.mTitle = title;
        this.mBitmap = null;
        this.mImageId = imageId;
    }

    public int compareTo(Object arg2) {
        return this.compareTo(((HistoryItem) arg2));
    }

    public int compareTo(HistoryItem another) {
        return this.mTitle.compareTo(another.mTitle);
    }

    public boolean equals(Object o) {

        if (this != (((HistoryItem) o))) {
            if (o != null && this.getClass() == o.getClass()) {
                HistoryItem historyItem = (HistoryItem) o;
                if (this.mId == historyItem.mId && this.mImageId == historyItem.mImageId) {
                    if (this.mBitmap != null) {
                        if (this.mBitmap.equals(historyItem.mBitmap)) {
                            return true;
                        }
                    } else if (historyItem.mBitmap == null && (this.mTitle.equals(historyItem.mTitle))
                            && (this.mUrl.equals(historyItem.mUrl))) {
                        return true;
                    }
                }

                return false;
            }

            return false;
        }
        return true;
    }

    public Bitmap getBitmap() {
        return this.mBitmap;
    }

    public String getFolder() {
        return this.mFolder;
    }

    public int getId() {
        return this.mId;
    }

    public int getImageId() {
        return this.mImageId;
    }

    public int getOrder() {
        return this.mOrder;
    }

    public String getTitle() {
        return this.mTitle;
    }

    public String getUrl() {
        return this.mUrl;
    }

    public int hashCode() {
        int v2 = ((this.mId * 31 + this.mUrl.hashCode()) * 31 + this.mTitle.hashCode()) * 31;
        int v1 = this.mBitmap != null ? this.mBitmap.hashCode() : 0;
        return (v2 + v1) * 31 + this.mImageId;
    }

    public void setBitmap(Bitmap image) {
        this.mBitmap = image;
    }

    public void setFolder(String folder) {
        this.mFolder = folder;
    }

    public void setID(int id) {
        this.mId = id;
    }

    public void setImageId(int id) {
        this.mImageId = id;
    }

    public void setOrder(int order) {
        this.mOrder = order;
    }

    public void setTitle(String title) {
        this.mTitle = title;
    }

    public void setUrl(String url) {
        this.mUrl = url;
    }

    public String toString() {
        return this.mTitle;
    }
}

